//...的作用
let [first, ...others] = ['Traveling', 'Swimming', 'Shopping']; 
console.log(others);   // ["Swimming", "Shopping"]


//shallow clone
const fruits = [{name:'Apple', price:100},{name:'Orange', price:80}];
let [...myFruits] = fruits;
console.log(myFruits[0].name);            // Apple
//增加元素 不影响原来的数组
myFruits.push({name:'Banana', price:90});
console.log(myFruits.length);             // 3
console.log(fruits.length);               // 2
//改变共有的元素 同时改变
myFruits[0].price = 110;
console.log(fruits[0].price);             // 110
fruits[1].price = 120;
console.log(myFruits[1].price);